<?php 
//var_dump($this->data);
$filter_order	= $this->filter_order;
$filter_order_Dir	=  $this->filter_order_Dir;
?>
<form action="<?php echo JRoute::_('index.php?option=com_sanpham&view=posts'); ?>" method="post" name="adminForm" id="adminForm">
	
	<fieldset id="filter-bar">
		<div class="filter-search fltlft">
			<label class="filter-search-lbl" for="filter_search">Filter:</label>
			<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->filter_search;  ?>" title="Search title or alias. Prefix with ID: to search for an article ID.">

			<button type="submit" class="btn">Search</button>
			<button type="button" onclick="document.id('filter_search').value='';this.form.submit();">Clear</button>
		</div>
	
	</fieldset>
	<table class="adminlist">
		<thead>
			<tr>
				<th><input type="checkbox" name="checkall-toggle" value="" title="Check All" onclick="Joomla.checkAll(this)"></th>
				<th>#</th>
				<th><?php echo JHtml::_('grid.sort', 'ID', 'id', $filter_order_Dir, $filter_order); ?></th>
				<th><?php echo JHtml::_('grid.sort', 'Title', 'title', $filter_order_Dir, $filter_order); ?></th>
				<th><?php echo JHtml::_('grid.sort', 'Content', 'content', $filter_order_Dir, $filter_order); ?></th>
				<th><?php echo JHtml::_('grid.sort', 'Created', 'created', $filter_order_Dir, $filter_order); ?></th>
				<th><?php echo JHtml::_('grid.sort', 'Published', 'published', $filter_order_Dir, $filter_order); ?></th>
				<th><?php echo JHtml::_('grid.sort', 'Important', 'important', $filter_order_Dir, $filter_order); ?></th>
			</tr>
		</thead>
		<tfoot>
			<tr><td colspan="8"><?php echo $this->pagination->getListFooter();?></td></tr>
		</tfoot>
		<tbody>
		<?php foreach($this->data as $key=>$item) {?>
				<tr class="row<?php echo $key % 2; ?>">
					<td><input type="checkbox" id="cb<?php echo $key; ?>" name="cid[]" value="<?php echo $item->id ?>" onclick="Joomla.isChecked(this.checked);" title="Checkbox for row <?php echo $key+1; ?>"></td>
					<td><?php echo $key+1 ?></td>
					<td><?php echo $item->id ?></td>
					<td><?php echo $item->title ?></td>
					<td><?php echo $item->content ?></td>
					<td><?php echo $item->created ?></td>
					<td><?php echo JHtml::_('grid.published', $item->published, $key); ?></td>
					<td><?php echo JHtml::_('grid.published', $item->important, $key); ?></td>
				</tr>
		<?php } ?>	
		</tbody>
		
	</table>
	
	<div>
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="" />
		<input type="hidden" name="filter_order" value="<?php echo $filter_order; ?>" />
		<input type="hidden" name="filter_order_Dir" value="<?php echo $filter_order_Dir; ?>" />
	</div>
</form>